# ----------------------------------------------------------------------
# Makefile
#
# Copyright (c) 2001 Niklas Elmqvist. All rights reserved.
# 
# File created 2001-07-21 by Niklas Elmqvist.
# ----------------------------------------------------------------------

# ----------------------------------------------------------------------
# Variables
# ----------------------------------------------------------------------

RM		= rm -f

LATEX 		= latex
XDVI	  	= xdvi
DVIPS	  	= dvips
DVIPDF		= dvipdf
PDFLATEX	= pdflatex

TARGET		= dyninsets.pdf

TEMPFILES	= *~ *.log *.aux *.toc *.lof *.lot *.bbl *.blg

# ----------------------------------------------------------------------
# Build Options
# ----------------------------------------------------------------------
.phony: all clean realclean

all: $(TARGET)

clean:
	$(RM) $(TEMPFILES)

realclean:
	$(RM) $(TEMPFILES) $(TARGET)

# ----------------------------------------------------------------------
# General rules
# ----------------------------------------------------------------------
%.dvi:	%.tex
	@echo Compiling LaTeX source for $<...
	$(LATEX) $<

%.ps:	%.dvi
	@echo Making PostScript document...
	$(DVIPS) $< -o $@ 2> /dev/null 

%.pdf:	%.tex %.bbl %.bib
	@echo Making PDF document...
	$(PDFLATEX) $<

%.bbl:	%.aux %.bib
	@echo Making bibliography file for $<...
	bibtex `basename $< .aux`

%-4.ps: %.ps
	mpage -4 $< > $@
